var request = require('request');
let data = require('../libs/data');
module.exports = {
    bmfw (req, res) {
        var url = req.url.substr(5);
        console.log(url);
        request({
            url: "http://192.168.16.3:8082"+url,
            method: "POST",
            headers: {
                "Content-Type": "application/json;charset=utf-8",
            },
        }, function (error, response, body) {
            console.log(error);
            console.log(body);
            if (!error && response.statusCode == 200) {
                if(body=='404null'){
                    res.status(200).send('404null');
                }else{
                    res.status(200).send(JSON.parse(body));
                }
            } else {
                data.success = false;
                data.result = '操作失败';
                res.status(200).send(data);
            }
        });
    }
};